package com.ruoyi.modules.screen.controller;


import com.ruoyi.modules.screen.service.ScreenService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/screen")
public class ScreenController {

    @Resource
    private ScreenService screenService;

    @GetMapping(value = "/data")
    public Map<String, Object> getScreenData ()
    {
        Map<String, Object> res = new HashMap<>();
        try{
            Map<String, String> data = screenService.getScreenData();
            res.put("data", data);
            res.put("code", 200);
            res.put("msg", "success");
        } catch (Exception e) {
            res.put("code", 500);
            res.put("msg", e.getMessage());
        }
        return res;
    }
}
